package com.zh.baselibrary.api;

import com.zh.baselibrary.netutils.BaseResp;
import com.zh.model.EquipmentLogin;
import com.zh.model.home.TokenBean;
import com.zh.model.request.LoginInfo;
import com.zh.model.task.home.ErrataSwipeBean;
import com.zh.model.task.home.ErrataSwipeResBean;
import com.zh.model.task.home.SwipingCardBean;
import com.zh.model.task.home.SwipingCardResBean;
import com.zh.model.task.subject.LoginResBean;

import java.util.List;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * @author EnzoChan
 * @create 2019/4/8
 * @desc:
 */
public interface ITaskLoginService {

    /**
     * 设备心跳
     *
     * @param equipmentCode
     * @return
     */
    @POST("/jdb/equipment/{equipmentCode}/heartbeat")
    Observable<BaseResp<Object>> heartbeat(@Path("equipmentCode") String equipmentCode);


    /**
     * 设备登录
     *
     * @return
     */
    @POST("/jdb/equipment/login")
    Observable<BaseResp<TokenBean>> equipmentLogin(@Body() EquipmentLogin equipmentLogin);



    /**
     * 课代表刷卡登录
     *
     * @return
     */
    @POST("/jdb/equipment/{schoolId}/login")
    Observable<BaseResp<LoginResBean>> login(@Path("schoolId") String schoolId, @Body LoginInfo info);

    /**
     * 勘误刷卡
     *
     * @param schoolId
     * @param cardCodeVO
     * @return
     */
    @POST("/jdb/equipment/{schoolId}/errataSwipe")
    Observable<BaseResp<List<ErrataSwipeResBean>>> errataSwipe(@Path("schoolId") String schoolId, @Body() ErrataSwipeBean cardCodeVO);

    /**
     * 勘误刷卡 V1.2.2
     *
     * @param cardCodeVO
     * @return
     */
    @POST("/jdb/equipment/errataSwipe")
    Observable<BaseResp<com.zh.model.task.error.ErrataSwipeResBean>> errataSwipe(@Body() ErrataSwipeBean cardCodeVO);

    /**
     * 关联作业刷卡登录
     *
     * @param cardCodeVO
     * @return
     */
    @POST("/jdb/equipment/swipingcard/login")
    Observable<BaseResp<SwipingCardResBean>> swipingCard(@Body() SwipingCardBean cardCodeVO);
}
